import 'package:flutter/material.dart';
import 'package:wanflutter/res/icons.dart';
import 'package:wanflutter/ui/page/page_collect_article.dart';
import 'package:wanflutter/ui/page/page_collect_website.dart';

class CollectPage extends StatefulWidget {
  @override
  State<CollectPage> createState() => _CollectPageState();
}

class _CollectPageState extends State<CollectPage> {

  ///标签页标签头
  final tabs = ["文章", "网站"];

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      ///tab标签的长度
      length: tabs.length,
      child: Scaffold(
        appBar: AppBar(
          title: Text('我的收藏'),
          bottom: TabBar(
            tabs: [
              Tab(
                icon: Icon(article, size: 32.0,), //此处采用了阿里图标库的图标
              ),
              Tab(
                icon: Icon(website, size: 32.0,),
              )
            ],
          ),
        ),
        body: TabBarView(
          children: [
            ArticleCollectPage(),
            WebsiteCollectPage(),
          ],
        ),
      ),
    );
  }
}
